<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>说一下盒模型 | Interview</title>
    <meta name="description" content="Interview with vitePress">
    <link rel="stylesheet" href="/t-blog/assets/style.c069affc.css">
    <link rel="modulepreload" href="/t-blog/assets/Home.00b10290.js">
    <link rel="modulepreload" href="/t-blog/assets/app.a747ab4f.js">
    <link rel="modulepreload" href="/t-blog/assets/CSS_index.md.1886c3ca.lean.js">
    <link rel="modulepreload" href="/t-blog/assets/app.a747ab4f.js">
    <link rel="icon" href="/favicon.ico">
    <meta name="twitter:title" content="说一下盒模型 | Interview">
    <meta property="og:title" content="说一下盒模型 | Interview">
  </head>
  <body>
    <div id="app"><!--[--><div class="theme"><header class="nav-bar" data-v-7161a24b><div class="sidebar-button" data-v-7161a24b><svg class="icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z" class></path></svg></div><a class="nav-bar-title" href="/t-blog/" aria-label="Interview, back to home" data-v-7161a24b data-v-4a583abe><!----> Interview</a><div class="flex-grow" data-v-7161a24b></div><div class="nav" data-v-7161a24b><nav class="nav-links" data-v-7161a24b data-v-15acbf05><!--[--><div class="item" data-v-15acbf05><div class="nav-link" data-v-15acbf05 data-v-641633f9><a class="item isExternal" href="https://www.cooldream.fun/home" target="_blank" rel="noopener noreferrer" data-v-641633f9>我的个人网站 <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-641633f9><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><div class="item" data-v-15acbf05><div class="nav-link" data-v-15acbf05 data-v-641633f9><a class="item isExternal" href="https://juejin.cn/user/1855631359481847/posts" target="_blank" rel="noopener noreferrer" data-v-641633f9>掘金 <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-641633f9><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><div class="item" data-v-15acbf05><div class="nav-link" data-v-15acbf05 data-v-641633f9><a class="item isExternal" href="https://github.com/Jack-Star-T" target="_blank" rel="noopener noreferrer" data-v-641633f9>Github <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-641633f9><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><!--]--><!----><!----></nav></div><!--[--><!--]--></header><aside class="sidebar" data-v-6b49cdcd><nav class="nav-links nav" data-v-6b49cdcd data-v-15acbf05><!--[--><div class="item" data-v-15acbf05><div class="nav-link" data-v-15acbf05 data-v-641633f9><a class="item isExternal" href="https://www.cooldream.fun/home" target="_blank" rel="noopener noreferrer" data-v-641633f9>我的个人网站 <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-641633f9><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><div class="item" data-v-15acbf05><div class="nav-link" data-v-15acbf05 data-v-641633f9><a class="item isExternal" href="https://juejin.cn/user/1855631359481847/posts" target="_blank" rel="noopener noreferrer" data-v-641633f9>掘金 <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-641633f9><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><div class="item" data-v-15acbf05><div class="nav-link" data-v-15acbf05 data-v-641633f9><a class="item isExternal" href="https://github.com/Jack-Star-T" target="_blank" rel="noopener noreferrer" data-v-641633f9>Github <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-641633f9><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><!--]--><!----><!----></nav><!--[--><!--]--><ul class="sidebar-links" data-v-6b49cdcd><!--[--><li class="sidebar-link"><p class="sidebar-link-item">HTML</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/HTML/">基础</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/HTML/advanced">进阶</a><!----></li></ul></li><li class="sidebar-link"><p class="sidebar-link-item">CSS</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item active" href="/t-blog/CSS/">基础</a><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="#说一下盒模型">说一下盒模型</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#如何理解外边距塌陷">如何理解外边距塌陷</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#单行文本溢出隐藏">单行文本溢出隐藏</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#link和-import的区别">link和@import的区别</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#display-none与visibility-hidden的区别">display:none与visibility:hidden的区别</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#z-index属性在什么情况下会失效">z-index属性在什么情况下会失效</a><!----></li></ul></li><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/CSS/advanced">进阶</a><!----></li></ul></li><li class="sidebar-link"><p class="sidebar-link-item">Javascript</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/Javascript/">基础</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/Javascript/advanced">进阶</a><!----></li></ul></li><li class="sidebar-link"><p class="sidebar-link-item">Vue</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/Vue/">基础</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/Vue/advanced">进阶</a><!----></li></ul></li><li class="sidebar-link"><p class="sidebar-link-item">浏览器</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/Vue/">基础</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/Vue/advanced">进阶</a><!----></li></ul></li><li class="sidebar-link"><p class="sidebar-link-item">网络</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/Network/">基础</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/Network/advanced">进阶</a><!----></li></ul></li><li class="sidebar-link"><p class="sidebar-link-item">安全</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/Security/">基础</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/Security/advanced">进阶</a><!----></li></ul></li><li class="sidebar-link"><p class="sidebar-link-item">面经</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/Experience/">基础</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="/t-blog/Experience/advanced">进阶</a><!----></li></ul></li><!--]--></ul><!--[--><!--]--></aside><!-- TODO: make this button accessible --><div class="sidebar-mask"></div><main class="page" data-v-7eddb2c4><div class="container" data-v-7eddb2c4><!--[--><!--]--><div style="position:relative;" class="content" data-v-7eddb2c4><div><h2 id="说一下盒模型"><a class="header-anchor" href="#说一下盒模型" aria-hidden="true">#</a> 说一下盒模型</h2><h2 id="如何理解外边距塌陷"><a class="header-anchor" href="#如何理解外边距塌陷" aria-hidden="true">#</a> 如何理解外边距塌陷</h2><h2 id="单行文本溢出隐藏"><a class="header-anchor" href="#单行文本溢出隐藏" aria-hidden="true">#</a> 单行文本溢出隐藏</h2><h2 id="link和-import的区别"><a class="header-anchor" href="#link和-import的区别" aria-hidden="true">#</a> link和@import的区别</h2><h2 id="display-none与visibility-hidden的区别"><a class="header-anchor" href="#display-none与visibility-hidden的区别" aria-hidden="true">#</a> display:none与visibility:hidden的区别</h2><h2 id="z-index属性在什么情况下会失效"><a class="header-anchor" href="#z-index属性在什么情况下会失效" aria-hidden="true">#</a> z-index属性在什么情况下会失效</h2></div></div><footer class="page-footer" data-v-7eddb2c4 data-v-fb8d84c6><div class="edit" data-v-fb8d84c6><div class="edit-link" data-v-fb8d84c6 data-v-1ed99556><!----></div></div><div class="updated" data-v-fb8d84c6><!----></div></footer><div class="next-and-prev-link" data-v-7eddb2c4 data-v-38ede35f><div class="container" data-v-38ede35f><div class="prev" data-v-38ede35f><a class="link" href="/t-blog/HTML/advanced" data-v-38ede35f><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" class="icon icon-prev" data-v-38ede35f><path d="M19,11H7.4l5.3-5.3c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0l-7,7c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.2-0.1,0.5,0,0.8c0.1,0.1,0.1,0.2,0.2,0.3l7,7c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L7.4,13H19c0.6,0,1-0.4,1-1S19.6,11,19,11z"></path></svg><span class="text" data-v-38ede35f>进阶</span></a></div><div class="next" data-v-38ede35f><a class="link" href="/t-blog/CSS/advanced" data-v-38ede35f><span class="text" data-v-38ede35f>进阶</span><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" class="icon icon-next" data-v-38ede35f><path d="M19.9,12.4c0.1-0.2,0.1-0.5,0-0.8c-0.1-0.1-0.1-0.2-0.2-0.3l-7-7c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l5.3,5.3H5c-0.6,0-1,0.4-1,1s0.4,1,1,1h11.6l-5.3,5.3c-0.4,0.4-0.4,1,0,1.4c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3l7-7C19.8,12.6,19.9,12.5,19.9,12.4z"></path></svg></a></div></div></div><!--[--><!--]--></div></main></div><!----><!--]--></div>
    <script>__VP_HASH_MAP__ = JSON.parse("{\"index.md\":\"9526c2f8\",\"css_advanced.md\":\"b4514e32\",\"css_index.md\":\"1886c3ca\",\"html_advanced.md\":\"3c922e72\",\"html_index.md\":\"dbc74871\",\"javascript_advanced.md\":\"338d31ad\",\"javascript_index.md\":\"71bdd912\"}")</script>
    <script type="module" async src="/t-blog/assets/app.a747ab4f.js"></script>
  </body>
</html>